package com.shuda.business.crm.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import java.time.LocalDateTime;

/**
 * 分配记录实体类：移除Lombok，提供显式访问器，保证方法引用兼容。
 */
@TableName("t_allocation_record")
@Schema(description = "分配记录实体")
public class AllocationRecordEntity {

    @TableId(type = IdType.AUTO)
    @Schema(description = "记录ID")
    private Long id;

    @Schema(description = "客户ID")
    private Long customerId;

    @Schema(description = "客户姓名")
    private String customerName;

    @Schema(description = "客户手机号")
    private String customerPhone;

    @Schema(description = "原分配用户ID")
    private Long originalUserId;

    @Schema(description = "原分配用户姓名")
    private String originalUserName;

    @Schema(description = "目标用户ID")
    private Long targetUserId;

    @Schema(description = "目标用户姓名")
    private String targetUserName;

    @Schema(description = "分配类型")
    private String allocationType;

    @Schema(description = "分配原因")
    private String allocationReason;

    @Schema(description = "分配状态")
    private String status;

    @Schema(description = "处理意见")
    private String processRemark;

    @Schema(description = "处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime processTime;

    @Schema(description = "分配人ID")
    private Long allocatedBy;

    @Schema(description = "分配人姓名")
    private String allocatedByName;

    @Schema(description = "分配时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime allocationTime;

    @Schema(description = "备注")
    private String remark;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建人ID")
    private Long createBy;

    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新人ID")
    private Long updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @TableLogic
    @Schema(description = "删除标志")
    private Boolean deleted;

    @Schema(description = "租户ID")
    private Long tenantId;

    /**
     * 以下为显式getter/setter，便于Lambda方法引用
     */
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public Long getCustomerId() { return customerId; }
    public void setCustomerId(Long customerId) { this.customerId = customerId; }

    public String getCustomerName() { return customerName; }
    public void setCustomerName(String customerName) { this.customerName = customerName; }

    public String getCustomerPhone() { return customerPhone; }
    public void setCustomerPhone(String customerPhone) { this.customerPhone = customerPhone; }

    public Long getOriginalUserId() { return originalUserId; }
    public void setOriginalUserId(Long originalUserId) { this.originalUserId = originalUserId; }

    public String getOriginalUserName() { return originalUserName; }
    public void setOriginalUserName(String originalUserName) { this.originalUserName = originalUserName; }

    public Long getTargetUserId() { return targetUserId; }
    public void setTargetUserId(Long targetUserId) { this.targetUserId = targetUserId; }

    public String getTargetUserName() { return targetUserName; }
    public void setTargetUserName(String targetUserName) { this.targetUserName = targetUserName; }

    public String getAllocationType() { return allocationType; }
    public void setAllocationType(String allocationType) { this.allocationType = allocationType; }

    public String getAllocationReason() { return allocationReason; }
    public void setAllocationReason(String allocationReason) { this.allocationReason = allocationReason; }

    public String getStatus() { return status; }
    public void setStatus(String status) { this.status = status; }

    public String getProcessRemark() { return processRemark; }
    public void setProcessRemark(String processRemark) { this.processRemark = processRemark; }

    public LocalDateTime getProcessTime() { return processTime; }
    public void setProcessTime(LocalDateTime processTime) { this.processTime = processTime; }

    public Long getAllocatedBy() { return allocatedBy; }
    public void setAllocatedBy(Long allocatedBy) { this.allocatedBy = allocatedBy; }

    public String getAllocatedByName() { return allocatedByName; }
    public void setAllocatedByName(String allocatedByName) { this.allocatedByName = allocatedByName; }

    public LocalDateTime getAllocationTime() { return allocationTime; }
    public void setAllocationTime(LocalDateTime allocationTime) { this.allocationTime = allocationTime; }

    public String getRemark() { return remark; }
    public void setRemark(String remark) { this.remark = remark; }

    public Long getCreateBy() { return createBy; }
    public void setCreateBy(Long createBy) { this.createBy = createBy; }

    public LocalDateTime getCreateTime() { return createTime; }
    public void setCreateTime(LocalDateTime createTime) { this.createTime = createTime; }

    public Long getUpdateBy() { return updateBy; }
    public void setUpdateBy(Long updateBy) { this.updateBy = updateBy; }

    public LocalDateTime getUpdateTime() { return updateTime; }
    public void setUpdateTime(LocalDateTime updateTime) { this.updateTime = updateTime; }

    public Boolean getDeleted() { return deleted; }
    public void setDeleted(Boolean deleted) { this.deleted = deleted; }

    public Long getTenantId() { return tenantId; }
    public void setTenantId(Long tenantId) { this.tenantId = tenantId; }
}